$eps-modal-background-color: theme-colors(light);
$eps-modal-width: px-to-rem(700);
$eps-modal-border-radius: $eps-radius;
$eps-modal-overlay: rgba(theme-colors(dark), $opacity-05);
$eps-modal-zindex: $eps-zindex-modal-backdrop;
$eps-modal-header-type: get-type(text, md);
$eps-modal-header-background-color: theme-colors(info);
$eps-modal-header-color: theme-colors(light);
$eps-modal-header-height: spacing(44);
$eps-modal-header-padding: spacing(10) spacing(16);
$eps-modal-header-border-radius: $eps-radius;
$eps-modal-icon-spacing: spacing(10);
$eps-modal-body-padding: spacing(30);
$eps-modal-close-button-spacing: spacing(16);
$eps-modal-close-button-border: solid 1px theme-colors(light);
$eps-modal-animation: $eps-pop-animation;
$eps-tip-padding: spacing(8);
$eps-tip-padding-inline-start: spacing(12);
$eps-tip-border-inline-start: 3px solid theme-colors(info);
$eps-tip-background-color: theme-colors(info-bg);
$eps-tip-margin-block-end: spacing(30);
$eps-tip-margin-block-start: spacing(30);

:root {
	--eps-modal-background-color: #{$eps-modal-background-color};
	--eps-modal-header-background-color: #{$eps-modal-header-background-color};
	--eps-tip-background-color: #{$eps-tip-background-color};
}

// Dark

$eps-dark-modal-background-color: dark-tints(900);
$eps-dark-modal-header-background-color: dark-theme-colors(info);
$eps-dark-tip-background-color: dark-theme-colors(info-bg);

.eps-theme-dark {
	--eps-modal-background-color: #{$eps-dark-modal-background-color};
	--eps-modal-header-background-color: #{$eps-dark-modal-header-background-color};
	--eps-tip-background-color: #{$eps-dark-tip-background-color};
}

/** ----------------------------------------------------------------
	EPS Modal
---------------------------------------------------------------- */

.#{$eps-prefix}modal {
	max-width: $eps-modal-width;
	background: var(--eps-modal-background-color);
	border-radius: $eps-modal-border-radius;
	animation: $eps-modal-animation;

	&__overlay {
		background: $eps-modal-overlay;
		position: fixed;
		display: flex;
		inset: 0;
		align-items: center;
		justify-content: center;
		z-index: $eps-modal-zindex;
	}

	&__header {
		font-size: $eps-modal-header-type;
		background: var(--eps-modal-header-background-color);
		height: $eps-modal-header-height;
		padding: $eps-modal-header-padding;
		border-radius: $eps-modal-header-border-radius;

		&,
		& .title {
			color: $eps-modal-header-color;
		}
	}

	&__icon {
		margin-inline-end: $eps-modal-icon-spacing;
	}

	&__body {
		padding: $eps-modal-body-padding;
	}

	&__tip, .#{$eps-prefix}tip {
		padding: $eps-tip-padding;
		padding-inline-start: $eps-tip-padding-inline-start;
		border-inline-start: $eps-tip-border-inline-start;
		background-color: var(--eps-tip-background-color);
		&:not(:last-child) {
			margin-block-end: $eps-tip-margin-block-end;
		}

		&:not(:first-child) {
			margin-block-start: $eps-tip-margin-block-start;
		}
	}

	&__section:not(:first-child) {
		margin-block-start: spacing(30);
	}

	&__close-wrapper {
		padding-inline-start: $eps-modal-close-button-spacing;
		border-inline-start: $eps-modal-close-button-border;
	}
}
